
using System;

namespace BSDS.Commands.Commands.Implementation
{
    public class HelpCommand : CommandBase
    {
        const string HelpMessage = "DESCRIPTION:\n" +
                                    " Command line application for batch execution of Bing Map Spatial Services\n"+
                                    " tasks.\n" +
                                    "OPTIONS:\n" +
                                    " /help         - print help information.\n" +
                                    " /toXML=<file> - convert source file to XML file. A new xml file is created.\n"+
                                    "                 Input data format is automatically recongnized.\n" +
                                    " /geocode=<file> [/toPipe|/toTab] /mode={all|empty|reverse} \n" +
                                    "                 [/outfile=<outfile>] [/upload=name] \n" +
                                    "               - submit geocode or reverse-geocode job, then optionally\n" +
                                    "                 download and merge the results with the original dataset.\n" + 
                                    "                 Then optinally upload the merged dataset to Bing Spatial\n" + 
                                    "                 Data Services.\n" +
                                    "                 /mode    - sets the mode of geocoding job.\n" +
                                    "                 /outfile - specifies the output file to store the geocoded\n" + 
                                    "                            dataset. If not specified a job file <file>.job\n" + 
                                    "                            will be generated. If not specified the application\n" + 
                                    "                            will save the geocoding job's ID in .job file and\n" +
                                    "                            exit. It specified the application will wait for\n" +
                                    "                            job completion and then upload mereged data into\n" +
                                    "                            BSDS. If not specified the application will save\n"+
                                    "                            the geocoding job's\n" +
                                    "                 /upload  - specifes if data should be uploaded after geocoding\n"+
                                    "                            and into which data source" +
                                    " /job=<file>.job [/merge]\n" +
                                    "               - checks the status of a previously-generated geocoding job. If \n" + 
                                    "                 /merge is pecified and job has completed, the geocoded\n" +
                                    "                 data will be downloaded and merged into the orginal file. In\n" + 
                                    "                 the other case job's status will be displayed.\n" +
                                    " /upload=<file> /name=<data source> /entity=<entity type> [/toPipe|/toTab] \n" +
                                    "               - uploads a dataset to BSDS using the provided data source name\n" + 
                                    "                 and entity type name. Input data can be either an XML or CSV\n" +
                                    "                 files. \n" +
                                    " /list [/datasource=<data source name>] \n" +
                                    "               - retrievs information about all data sources associated with\n"+
                                    "                 the Bing Map Key used. If data source name is specified\n" +
                                    "                 then a detailed information about data source will be\n" +
                                    "                 downloaded.\n" +
                                    " /delete=<data source name>\n" +
                                    "               - deletes the data source associated with the specified\n" +
                                    "                 data source.\n" +
                                    " /schema=<data source name>\n" +
                                    "               - download the XML schema for the specifed data source.\n" +
                                    "                 The schema is saved to <data source name>.xsd file.\n";


        public override CommandResult Execute(ExecutionContext context)
        {
            Console.WriteLine(HelpMessage);

            return CommandResult.Success();
        }
    }
}